package com.patternsbox.structural.flyweight;

import java.util.Hashtable;

class FlyweightFactory {

	private Hashtable<String, Flyweight> flyweights = new Hashtable<String, Flyweight>();

	// Constructor
	public FlyweightFactory() {
		flyweights.put("X", new ConcreteFlyweight());
		flyweights.put("Y", new ConcreteFlyweight());
		flyweights.put("Z", new ConcreteFlyweight());
	}

	public Flyweight getFlyweight(String key) {
		return flyweights.get(key);
	}
}
